#include <iostream>
using namespace std;

class Complex
{
public:
    Complex():m_real(0.0), m_imag(0.0){}
    Complex(double real, double imag)
    :m_real(real), m_imag(imag){}

    Complex operator+(const Complex& obj)
    {
       Complex tmp(m_real + obj.m_real, m_imag + obj.m_imag);
       return tmp;
    }
    #if 1
    //前置（内部实现)重载一元加法运算
    Complex& operator++()
    {
        m_real++;
        m_imag++;
        return *this;
    }   
    #else
    /*  前置++ 全局实现 */
    Complex& operator++(Complex& obj)
    {
        
    }
 
    #endif
    //后置
    Complex operator++(int)
    {
        Complex tmp = *this;
        this->m_real++;
        this->m_imag++;
        return tmp;
    }
 
public:
    void display()const
    {
        cout<<m_real<<"+"<<m_imag<<"i"<<endl;
    }
private:
    int m_real;
    int m_imag;

};


int main()
{
    Complex t1(1,1);
    Complex t2(2,2);
    Complex t3;

    #if 1
    t3 =  ++t1 + t2;
    t3.display();
    #else
    t3 =  t1++ + t2;
    t3.display();
    #endif
    return 0;
}

